package mortal.game.control
{
    import com.gengine.resource.*;
    import com.gengine.resource.info.*;
    import flash.geom.*;
    import mortal.game.events.*;
    import mortal.game.mvc.*;
    import mortal.game.resource.info.*;
    import mortal.game.scene.player.entity.*;
    import mortal.game.view.award.*;
    import mortal.mvc.core.*;

    public class FlyEntityController extends Controller
    {

        public function FlyEntityController()
        {
            
        }

        override protected function initServer() : void
        {
            Dispatcher.addEventListener(EventName.BackPackAddTaskEntity, this.onBackPackAddTaskEntityHandler);
            
        }

        private function onBackPackAddTaskEntityHandler(event:DataEvent) : void
        {
            var e:* = event;
            var itemData:* = e.data as ItemData;
            var icon:* = itemData.itemInfo.item.icon + ".jpg";
            with ({})
            {
                {}.onLoaded = function (param1:ImageInfo) : void
            {
                var _loc_2:* = new Point(RolePlayer.instance.stagePointX, RolePlayer.instance.stagePointY);
                FlyToNavbarTool.flyToBackPack(param1.bitmapData, _loc_2);
                
            }
            ;
            }
            LoaderManager.instance.load(icon, function (param1:ImageInfo) : void
            {
                var _loc_2:* = new Point(RolePlayer.instance.stagePointX, RolePlayer.instance.stagePointY);
                FlyToNavbarTool.flyToBackPack(param1.bitmapData, _loc_2);
                
            }
            );
            
        }

    }
}
